/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.jhelper.unit06.demo;

import java.util.*;

/**
 *
 * @author Administrator
 */
public class BookDemo {
    public static void main(String[] args) {
       
            Hashtable h = new Hashtable();
            BookBean temp = null;
            
            h.put("isbn001",new BookBean("isbn001","红楼梦","曹雪芹","人民教育出版社",100));
            h.put("isbn002",new BookBean("isbn002","西游记","吴承恩","人民教育出版社",100));
            h.put("isbn003",new BookBean("isbn003","水浒传","施耐庵","人民教育出版社",100));
            h.put("isbn004",new BookBean("isbn004","三国演义","罗贯中","人民教育出版社",100));
            h.put("isbn005",new BookBean("isbn005","喻世明言","冯梦龙","人民教育出版社",100));
            
           
        System.out.println(h);
        
         String find = "isbn001";
         if (h.containsKey(find)){
             temp = (BookBean)h.get(find);
             System.out.println("书名:"+temp.getName());
             System.out.println("作者:"+temp.getAuthor());
             System.out.println("出版社:"+temp.getPublisher());
             System.out.println("编号:"+temp.getIsbn());
             System.out.println("价格:"+temp.getPrice());
         }else{
             System.out.println("查无此书！");
  
        }
        
        
    }
}
